﻿/**
 * @file   FITKAbaqusAdaptorElement.h
 * @brief Abaqus Element 单元 适配器
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date 2024-06-21
 */
#ifndef __FITKABAQUSADAPTORELEMENT__H__
#define __FITKABAQUSADAPTORELEMENT__H__

#include "FITKAbaqusAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

ForwardDeclarNS(Interface, FITKAbstractModel)

namespace IO
{
    /**
     * @brief 单元 读写适配器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-06-20
     */
    class FITKAbaqusIOINPAPI FITKAbaqusAdaptorElement : public FITKAbaqusAbstractAdaptor
    {
    public:
        explicit FITKAbaqusAdaptorElement() = default;
        ~FITKAbaqusAdaptorElement() = default;


        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-20
         */
        bool adaptW() override;

        /**
         * @brief 设置写出单元的编号
         * @param writeElementId elementId
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-05-28
         */
        void setWriteElementId(int* writeElementId);

    private:
        /**
         * @brief 读取part下的单元-初始单元
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool readPartElement();

        /**
         * @brief 写出part下的单元-初始单元
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool writePartElement();

        /**
         * @brief 读取Element, Type=ROTARYI/MASS，用于质量点和惯量 part
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-21
         */
        bool readPartElementInertia();
        /**
         * @brief 读取Element, Type=ROTARYI/MASS，用于质量点和惯量 assembly
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-21
         */
        bool readAssemblyElementInertia();
        /**
         * @brief 读取Element, Type=Spring/Dashpot，用于弹簧 part
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-21
         */
        bool readPartElementSpringDashpot();
        /**
         * @brief 读取Element, Type=Spring/Dashpot，用于弹簧 assembly
         * @return 状态 true成功， false失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-21
         */
        bool readAssemblyElementSpringDashpot();
        /**
         * @brief 读取Element, Type=CONN3D2，用于连接器 assembly
         * @return 
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-24
         */
        bool readAssemblyElementConnector();

    private:
        /**
         * @brief 模型数据 part assembly instance
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-06-21
         */
        Interface::FITKAbstractModel* _modelData{};
        /**
         * @brief 写出的编号
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-05-30
         */
        int* _writeElementId{};
    };

}

#endif